<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <meta name="viewport" content="width=device-width,initial-scale=1,user-scalable=0">
</head>
<body>
<input type="file" id='upload' />

<script>
    document.getElementById('upload').addEventListener('change', function (e) {
        var file = this.files[0];
        const reader = new FileReader();
        reader.onload = function () {
            const result = reader.result;
            console.log(result);
        }
        reader.readAsText(file);
    }, false);
</script>

</body>
</html>
